import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    },
	{
		path: '/admin/login',
		name: 'admin_login',
		component: () => import("./views/admin/login/login.vue")
	},
	{
		path: '/admin/main',
		name: 'admin_main',
		component: () => import("./views/admin/users/main.vue"),
		redirect: "/admin/home",
		children: [
			// 管理后台首页
			{
				path: '/admin/home',
				name: 'admin_home',
				component: () => import("./views/admin/home/home.vue"),
			},
			{
				path: '/admin/imageclass',
				name: 'admin_imageclass',
				component: () => import("./views/admin/home/imageclass.vue"),
				meta: {
					bread: [{name: "相册管理"}]
				}
			},
			{
				path: '/admin/shop',
				name: 'admin_shop',
				component: () => import("./views/admin/shop/shop.vue"),
				meta: {
					bread: [{name: "商品列表"}]
				}
			},
			{
				path: '/admin/order',
				name: 'admin_order',
				component: () => import("./views/admin/order/order.vue"),
				meta: {
					bread: [{name: "订单列表"}]
				}
			},
			{
				path: '/admin/member',
				name: 'admin_member',
				component: () => import("./views/admin/member/member.vue"),
				meta: {
					bread: [{name: "会员列表"}]
				}
			},
			{
				path: '/admin/setting',
				name: 'admin_setting',
				component: () => import("./views/admin/setting/setting.vue"),
				meta: {
					bread: [{name: "基础设置"}]
				}
			}
		]
	}
  ]
})
